var pageFun=function(){
			this.pageObj=$(".pagelist div.pagination");
			this.currentObj=$(".pagelist .currentPage");            //当前页
			this.totalObj=$(".pagelist .totalpage");				//总页数
			this.perpageObj=$(".pagelist .perpage");				//每页大小
			this.gotoPageObj=$(".pagelist .gotopage");				//跳页
			this.tt=$('.pagelist .totalnumber');					//总数量
			this.perPage=10;
			this.currentPage=1;
			this.totalNumber=50;
			this.containerID='';
			this.count=0;
			this.pageNoObj='';
			this.submitFun=function(){ };
			this.init=function(perPage,currentPage,totalnumber,containerID){
				this.perPage=perPage; this.currentPage=currentPage; this.totalNumber=totalnumber; this.containerID=containerID;
				this.setPage();
				this.jumpPage();
			},
			this.setPage=function(){
				var self=this;
				self.pageObj.jPages({
				containerID: self.containerID,
				previous: "上一页",
				next: '下一页',
				perPage: self.perPage,
				totalNumber:self.totalNumber,
				startPage:self.currentPage,
				callback: function(pages, items) {
					if(self.totalNumber == 0){
						$(self.currentObj).html(0);
					}else{
						$(self.currentObj).html(pages.current);
					}
					$(self.totalObj).html(pages.count);
					$(self.perpageObj).html(self.perPage);
                    $(self.tt).html(self.totalNumber);

                    if(self.pageNoObj){
						$(self.pageNoObj).val(pages.current);
					}
					if((self.count>0)){
						self.submitFun();
					}
					++self.count;
				},
			  });
			};
			this.jumpPage=function(){
				var self=this;
				$(".gotopage_button").click(function() {
					var page = parseInt($(self.gotoPageObj).val()); //获取要跳转的页码
					$(self.pageObj).jPages(page);
			    });
			    $(self.gotoPageObj).keypress(function(){
			    	var e=window.event||this;
			    	var c=e.keyCode||e.which;
			    	if(c==13){
			    	   var page = parseInt($(self.gotoPageObj).val()); //获取要跳转的页码
					   $(self.pageObj).jPages(page);
			    	} 
			    })
			};
		}
		